#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>
#include <sys/un.h>
#include <stdlib.h>
#define MAXLINE 4096
#define SA struct sockaddr
#define LISTENQ 20

int main(int argc, char **argv){

int listenfd, connfd, n;
struct sockaddr_in servaddr;
char buff[MAXLINE];
time_t ticks;

listenfd = socket(AF_INET, SOCK_STREAM, 0);

bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(8585);

if (n = bind(listenfd, (SA *) &servaddr, sizeof(servaddr)) <0){
 printf("Bind error\n");
 return(0);}

if (n = listen(listenfd, LISTENQ) <0){
 printf("listen error\n");
 return(0);}

for ( ; ; ) {
 connfd = accept(listenfd, (SA *) NULL, NULL);
 ticks = time(NULL);
 buff = "tralalalala"
 write(connfd, buff, strlen(buff));
 close(connfd);
}










}
